package com.gitee.dupe.ext.controller;

import com.gitee.dolt.boot.properties.BootProperties;
import com.gitee.dolt.core.base.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author LYH
 */
@RestController
@RequestMapping("/b/decrypt")
@Validated
@Api(value = "Decrypt", tags = "加密")
@RequiredArgsConstructor
public class DecryptController {

    private final BootProperties bootProperties;

    @GetMapping("/getRsaPub")
    @ApiOperation(value = "获取Rsa公钥")
    public Result getRsaPub() {
        BootProperties.DecryptProperties decryptProperties = bootProperties.getDecrypt();
        return Result.ok(decryptProperties.getRsaPub());
    }
}
